/* 容器样式 */
.container {
	height: 100vh;
	position: relative;
	background: #fff;
}

.safe-area {
	height: 120rpx;
	width: 100%;
}


.fixed-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background-color: #F8F9FD;
	z-index: 999;
}

/* 主内容区域 */
.main-content {
	height: 100%;
	transition: transform 0.3s ease;
}

.main-content.sidebar-open {
	transform: translateX(500rpx);
}

/* 导航栏样式 */
.nav-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 88rpx;
	padding: 0 30rpx;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 100;
	border-bottom: 1rpx solid #eee;

	padding-top: 150rpx;
	padding-left: 30rpx;
	padding-right: 30rpx;
}

.menu-btn, .new-chat-btn {
	width: 48rpx;
	height: 48rpx;
	padding: 10rpx;
}

.menu-btn image, .new-chat-btn image {
	width: 100%;
	height: 100%;
}

.title {
	font-size: 32rpx;
	font-weight: 500;
}

/* 聊天区域样式 */
.chat-container {
	height: 100%;
	padding: 250rpx 30rpx 450rpx;
	box-sizing: border-box;
}

/* 欢迎区域样式 */
.welcome-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 140rpx 0;
}

.logo {
	width: 120rpx;
	height: 120rpx;
	margin-bottom: 30rpx;
}

.welcome-title {
	font-size: 40rpx;
	font-weight: bold;
	margin-bottom: 20rpx;
}

.welcome-subtitle {
	font-size: 28rpx;
	color: #666;
	text-align: center;
}

/* 消息列表样式 */
.messages {
	display: flex;
	flex-direction: column;
}

.message {
	max-width: 100%;
	margin: 10rpx 0;
}

.message-user {
	align-self: flex-end;
}

.message-ai {
	align-self: stretch;
	width: 100%;
}

/* 消息内容基础样式 */
.message-content {
	padding: 24rpx 36rpx;
	border-radius: 30rpx;
	font-size: 28rpx;
	line-height: 1.6;
}

/* AI消息样式 */
.message-ai .message-content {
	background: none;
	padding: 24rpx 48rpx;
	width: 95%;
}

/* 用户消息样式 */
.message-user .message-content {
	background: #4e80ee;
	color: #fff;
	margin-left: auto;
	max-width: 100%;
	line-height: 1.2;
	padding: 24rpx 36rpx;
}

/* 侧边栏样式 */
.sidebar {
    padding-top: 100rpx;
    position: fixed;
    top: 0;
    left: -500rpx;
    width: 500rpx;
    height: 100vh;
    background: #fff;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2rpx 0 10rpx rgba(0,0,0,0.1);
}

.sidebar.show {
    left: 0;
}

.sidebar-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.sidebar-header {
    padding: 40rpx 32rpx;
    font-size: 36rpx;
    font-weight: 600;
    color: #333;
    border-bottom: 2rpx solid #f5f5f5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.chat-list {
    height: calc(100vh - 90rpx);
    padding: 20rpx 0;
}

.chat-item {
    padding: 32rpx;
    border-bottom: 2rpx solid #f5f5f5;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12rpx;
}

.chat-item:active {
    background-color: #f8f8f8;
}

.chat-item.active {
    background-color: #EBF3FF;
}

.chat-title {
    font-size: 32rpx;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chat-item.active .chat-title {
    color: #4C6FFF;
    font-weight: 600;
}

.chat-time {
    font-size: 24rpx;
    color: #999;
    margin-top: 4rpx;
}



/* 输入区域样式 */
.input-area {
  position: fixed;
  bottom: 150rpx;
  left: 0;
  right: 0;
  padding-top: 30rpx;
  padding-bottom: 80rpx;
  padding-left: 30rpx;
  padding-right: 50rpx;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 20rpx;
  border-top: 1rpx solid #eee;
  z-index: 99;
}

/* 深度搜索开关 */
.search-toggle {
  display: flex;
  align-items: center;
  gap: 8rpx;
  padding: 12rpx 24rpx;
  background: rgba(76, 111, 255, 0.1);
  border-radius: 30rpx;
  font-size: 28rpx;
  color: rgba(76, 111, 255, 0.6);
  width: fit-content;
  transition: all 0.3s ease;
}

.search-toggle.active {
  background: rgba(76, 111, 255, 0.2);
  color: #4C6FFF;
}

.search-toggle image {
  width: 32rpx;
  height: 32rpx;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.search-toggle.active image {
  opacity: 1;
}

/* 输入框容器 */
.input-wrapper {
  position: relative;
  width: 100%;
}

/* 输入框样式 */
.input-box {
  width: 100%;
  height: 20%;
  padding: 20rpx;
  background: #f5f6f7;
  border-radius: 50rpx;
  font-size: 28rpx;
  min-height: 72rpx;
  max-height: 160rpx;
}

/* 发送按钮样式 */
.send-btn {
  position: absolute;
  right: 50rpx;
  bottom: 80rpx;
  width: 64rpx;
  height: 64rpx;
  border-radius: 32rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(76, 111, 255, 0.3);
  transition: all 0.3s ease;
}

.send-btn.active {
  background: #4C6FFF;
}

.send-btn image {
  width: 42rpx;
  height: 42rpx;
  filter: brightness(0) invert(1);
}

/* 保持原有的底部导航栏样式不变 */
.tab-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 120rpx;
	background: white;
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding-bottom: env(safe-area-inset-bottom);
	box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
	z-index: 999; /* 确保导航栏在最上层 */
}

.tab-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
}

.tab-item.active {
	color: #4C6FFF;
}

/* 激活状态下的文字颜色 */
.tab-item.active .tab-text {
	color: #333;
	font-weight: 500;
	transform: scale(1.05);
}

.tab-icon {
	width: 48rpx;
	height: 48rpx;
	margin-bottom: 6rpx;
	transition: all 0.3s ease-in-out;
}

/* 设置图标旋转动画 */
.tab-item[data-tab="setting"].active .tab-icon {
	transform: rotate(180deg);
}

/* 其他图标放大动画 */
.tab-item:not([data-tab="setting"]).active .tab-icon {
	transform: scale(1.1);
}

.tab-text {
	font-size: 24rpx;
	transition: all 0.3s ease-in-out;
	color: #666;
}

.tab-item-center {
	transform: translateY(-30rpx);
	position: relative;
	z-index: 10;
}

/* 中间按钮样式 */
.center-button {
	width: 100rpx;
	height: 100rpx;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	background-color: #4C6FFF;
	padding: 20rpx;
	box-shadow: 0 4rpx 8rpx rgba(76, 111, 255, 0.3);
}

/* 激活状态的样式 */
.center-button.active {
	background-color: #FF69B4;
	box-shadow: 0 4rpx 8rpx rgba(255, 105, 180, 0.3);
	animation: bounceAndRotate 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.center-button image {
	width: 60%;
	height: 60%;
	filter: brightness(0) invert(1);
}

.center-button.active image {
	filter: brightness(0) invert(1);
}

/* 组合动画 */
@keyframes bounceAndRotate {
	0%, 100% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(-15rpx) rotate(180deg);
	}
}

/* 添加点击效果 */
.center-button:active {
	transform: scale(0.95);
}

/* 移除原来的加号样式 */
.center-icon {
	display: none;
}

/* 加载动画样式 */
.loading-dots {
  display: flex;
  align-items: center;
  gap: 8rpx;
  padding: 20rpx 30rpx;
  min-width: 100rpx;
}

.loading-dots .dot {
  width: 10rpx;
  height: 10rpx;
  background: #4C6FFF;
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.4s infinite ease-in-out;
}

.loading-dots .dot:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots .dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.2;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 代码块容器样式 */
.markdown-pre {
    background: #1E1E1E;
    border-radius: 8rpx;
    margin: 20rpx 0;
    position: relative;
    overflow: hidden;
}

/* 代码块头部 */
.code-header {
    background: #323232;
    padding: 12rpx 24rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24rpx;
    color: #CCCCCC;
}

/* 语言标识 */
.code-language {
	color: #999;
}

/* 复制按钮 */
.copy-btn {
	display: flex;
	align-items: center;
	gap: 8rpx;
	padding: 4rpx 12rpx;
	border-radius: 6rpx;
	background: rgba(255, 255, 255, 0.1);
}

.copy-btn image {
	width: 28rpx;
	height: 28rpx;
	opacity: 0.6;
}

/* 代码内容区域 */
.code-content {
    padding: 24rpx;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 26rpx;
    line-height: 1.6;
    overflow-x: auto;
    color: #D4D4D4;
    white-space: pre;
}

/* 语法高亮颜色 */
.code-keyword { color: #569CD6; }    /* 关键字 如 class, public */
.code-type { color: #4EC9B0; }       /* 类型 如 String, int */
.code-string { color: #CE9178; }     /* 字符串 */
.code-number { color: #B5CEA8; }     /* 数字 */
.code-comment { color: #6A9955; }    /* 注释 */
.code-operator { color: #D4D4D4; }   /* 运算符 */
.code-function { color: #DCDCAA; }   /* 函数名 */
.code-variable { color: #9CDCFE; }   /* 变量名 */
.code-tag { color: #569CD6; }        /* HTML标签 */
.code-attr { color: #9CDCFE; }       /* HTML属性 */
.code-value { color: #CE9178; }      /* 属性值 */
.code-punctuation { color: #D4D4D4; } /* 标点符号 */

/* Markdown样式 */
.markdown-h1,
.markdown-h2,
.markdown-h3,
.markdown-h4,
.markdown-h5,
.markdown-h6 {
	margin: 16rpx 0;
	font-weight: bold;
	line-height: 1.4;
}

.markdown-h1 { font-size: 40rpx; }
.markdown-h2 { font-size: 36rpx; }
.markdown-h3 { font-size: 32rpx; }
.markdown-h4 { font-size: 28rpx; }
.markdown-h5 { font-size: 24rpx; }
.markdown-h6 { font-size: 20rpx; }

.markdown-p {
	margin: 12rpx 0;
	line-height: 1.6;
}

.markdown-code {
	background-color: #f0f0f0;
	padding: 4rpx 8rpx;
	border-radius: 4rpx;
	font-family: Consolas, Monaco, 'Courier New', monospace;
	font-size: 24rpx;
}

.markdown-quote {
	border-left: 8rpx solid #ddd;
	padding: 0 16rpx;
	color: #666;
	margin: 12rpx 0;
	font-style: italic;
}

.markdown-ul,
.markdown-ol {
	padding-left: 32rpx;
	margin: 12rpx 0;
}

.markdown-li {
	margin: 8rpx 0;
}

.markdown-table {
	border-collapse: collapse;
	width: 100%;
	margin: 12rpx 0;
	background-color: #fff;
}

.markdown-th,
.markdown-td {
	border: 2rpx solid #ddd;
	padding: 12rpx;
	text-align: left;
}

.markdown-th {
	background-color: #f8f8f8;
	font-weight: bold;
}

/* 图片样式 */
.message-content image {
	max-width: 100%;
	height: auto;
	margin: 12rpx 0;
	border-radius: 8rpx;
}

/* 链接样式 */
.message-content a {
	color: #4C6FFF;
	text-decoration: none;
}

/* 分割线样式 */
.message-content hr {
	border: none;
	border-top: 2rpx solid #eee;
	margin: 20rpx 0;
}